//
//  FreeGoodsInforBottomView.m
//  GLGW_Shoping
//
//  Created by yang on 2018/12/6.
//  Copyright © 2018年 yang. All rights reserved.
//

#import "FreeGoodsInforBottomView.h"

@implementation FreeGoodsInforBottomView

-(id)initWithFrame:(CGRect)aFrame inSuperView:(UIView *)aSuperView{
    if (self = [super initWithFrame:aFrame inSuperView:aSuperView]) {
        self.backgroundColor = [UIColor whiteColor];
        GLGWButton * syscBut = [[GLGWButton alloc] initWithFrame:CGRectMake(kWidthProportion_In_iPhoneTriploid(122), kHeightProportion_In_iPhoneTriploid(10), KScreenWidth - kWidthProportion_In_iPhoneTriploid(137), kHeightProportion_In_iPhoneTriploid(40)) hTitle:@"同步到店铺" titleLableFont:SYSTEMFONT(16) titleLableColor:[UIColor whiteColor] theCornerRadius:kHeightProportion_In_iPhoneTriploid(20) backgroundColr:kColor_Rule_Yellow inSuperView:self];
        syscBut.tag = 300;
        [syscBut addTarget:self action:@selector(freeGoodsInfroAction:) forControlEvents:UIControlEventTouchUpInside];
        //
        NSArray * titArr = @[@"店铺",@"联系卖家"];
        for (int i =0; i<2; i++) {
            GLGWButton * leftBut = [[GLGWButton alloc] initWithFrame:CGRectMake(kWidthProportion_In_iPhoneTriploid(60)*i, 0, kWidthProportion_In_iPhoneTriploid(60), self.height) titleText:titArr[i] titleLableFont:SYSTEMFONT(10) titleLableColor:[UIColor colorWithHexString:@"#999999"] inSuperView:self];
            if (i==0) {
                [leftBut setTitleColor:kColor_Rule_Yellow forState:UIControlStateNormal];
            }
            leftBut.tag = 301+i;
            [leftBut addTarget:self action:@selector(freeGoodsInfroAction:) forControlEvents:UIControlEventTouchUpInside];
        }
        
    }
    return self;
}

-(void)setB_type:(BaoJiaType)b_type{
    _b_type = b_type;
    if (_b_type == BaoJiaType_BaoJia) {
        GLGWButton * butCofimoBut = (GLGWButton *)[self viewWithTag:300];
        GLGWButton * shareBut = (GLGWButton *)[self viewWithTag:301];
        GLGWButton * needManBut = (GLGWButton *)[self viewWithTag:302];
        butCofimoBut.title = @"我要报价";
        shareBut.title = @"分享";
        [shareBut setTitleColor:[UIColor colorWithHexString:@"#999999"] forState:UIControlStateNormal];
        needManBut.title = @"联系求购人";
    }
}

-(void)freeGoodsInfroAction:(GLGWButton *)sender{
    if (self.Block_FreeGoodsInfor) {
        self.Block_FreeGoodsInfor(sender);
    }
}

@end
